﻿namespace QuickTuner
{
    /// <summary>
    /// Provides an interface against a station playing engine.
    /// So different station playing code can be employed by radio objects.
    /// </summary>
    public interface IPlayEngine
    {
        /// <summary>
        /// Gets wether the play engine is already playing something.
        /// </summary>
        bool IsPlaying { get; }

        /// <summary>
        /// Gets the current URL the play engine is playing.
        /// </summary>
        string CurrentUrl { get; }

        /// <summary>
        /// Gets wether the play engine supports fast hard-stopping for quick shutdown.
        /// </summary>
        bool SupportHardStop { get; }

        /// <summary>
        /// Plays the supplied station url.
        /// </summary>
        void Play(string stationUrl);

        /// <summary>
        /// Stops currently playing station, if any.
        /// </summary>
        void Stop();

        /// <summary>
        /// Stops the engine in as few instructions as possible.
        /// Play engine state can be invalid after this call.
        /// </summary>
        /// <remarks>
        /// This is made in case that a browser-based play engine
        /// might be faster "disposed" than "stopped". This is made
        /// as to eliminate the "Stop" freezes on QuickTuner shutdown.
        /// </remarks>
        void HardStop();
    }
}